<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>清除浮动最佳实践</title>
        <style>
            .fl { float: left;*display:inline; }
            .fr { float: right;*display:inline; }
            .clearfix:after { display: block; clear: both; content: ""; visibility: hidden; height: 0; }
            .clearfix1:after { content:'';display: table-cell; clear: both;}
            .clearfix { zoom: 1; }
            .box-200-200{
                width: 200px;
                height: 200px;
            }
            .box-600-200{
                width: 600px;
                height: 200px;
            }
            .bgc-pink{
                background-color: pink;
            }
            .bgc-purple{
                background-color: purple;
            }
        </style>
    </head>
    <body>
        <p>加了清除浮动</p>
        <div class="clearfix">
            <div class="fl box-200-200 bgc-pink">横沙岛</div>
            <div class="fr box-600-200 bgc-purple">枸杞岛</div>
        </div>
        <p>不加清除浮动</p>
        <div>
            <div class="fl box-200-200 bgc-pink">横沙岛</div>
            <div class="fr box-600-200 bgc-purple">枸杞岛</div>
        </div>
        <p>梦想是要有的，万一实现了呢？</p>
    </body>
</html>